
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>手写代码 · 千锋大前端小册-企业面试真题</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="古艺散人">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../algorithm/" />
    
    
    <link rel="prev" href="../security/" />
    

    
        <link rel="shortcut icon" href='../source/images/favicon.jpg' type="image/x-icon">
    
    
        <link rel="bookmark" href='../source/images/favicon.jpg' type="image/x-icon">
    
    
        <link rel="apple-touch-icon" href='../source/images/apple-touch-icon.jpg'>
    
    
        
        <link rel="apple-touch-icon" sizes="120x120" href="../source/images/apple-touch-icon.jpg">
        
        <link rel="apple-touch-icon" sizes="180x180" href="../source/images/apple-touch-icon.jpg">
        
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"lurongtao","repo":"felixbooks-interview","type":"star","size":"small","count":true}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../HTML+CSS/">
            
                <a href="../HTML+CSS/">
            
                    
                    HTML5+CSS3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../javascript/">
            
                <a href="../javascript/">
            
                    
                    JavaScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../node/">
            
                <a href="../node/">
            
                    
                    Node.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../vue/">
            
                <a href="../vue/">
            
                    
                    Vue.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../react/">
            
                <a href="../react/">
            
                    
                    React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../weapp/">
            
                <a href="../weapp/">
            
                    
                    小程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../browser/">
            
                <a href="../browser/">
            
                    
                    浏览器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../network/">
            
                <a href="../network/">
            
                    
                    网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../engineering/">
            
                <a href="../engineering/">
            
                    
                    前端工程化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../performance/">
            
                <a href="../performance/">
            
                    
                    性能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../security/">
            
                <a href="../security/">
            
                    
                    安全
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.13" data-path="./">
            
                <a href="./">
            
                    
                    手写代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../algorithm/">
            
                <a href="../algorithm/">
            
                    
                    高频算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../others/">
            
                <a href="../others/">
            
                    
                    综合
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../thanks/">
            
                <a href="../thanks/">
            
                    
                    感谢
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >手写代码</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#&#x76EE;&#x5F55;"><b></b>&#x76EE;&#x5F55;</a></li><li><span class="title-icon "></span><a href="#&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;"><b></b>&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;</a></li><ul><ul><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;foreach-map-filter-reduce"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;forEach map filter reduce</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684;-vue-reactive"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684; Vue Reactive</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;promise"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;Promise</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;instanceof"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;instanceOf</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;ajax"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;ajax</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;jsonp&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;JSONP&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-bind"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; bind</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-call"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; call</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-apply"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; apply</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectcreate"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF; object.create</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectis"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF; Object.is</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-new-"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; new </a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD;-"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD; </a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0;-asyncawait"><b></b>&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0; async/await</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;&#x8BA2;&#x9605;&#x6A21;&#x5F0F;"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;/&#x8BA2;&#x9605;&#x6A21;&#x5F0F;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x9632;&#x6296;"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x9632;&#x6296;</a></li><li><span class="title-icon "></span><a href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x8282;&#x6D41;"><b></b>&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x8282;&#x6D41;</a></li></ul></ul></ul></div><a href="#&#x76EE;&#x5F55;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x76EE;&#x5F55;"><a name="&#x76EE;&#x5F55;" class="anchor-navigation-ex-anchor" href="#&#x76EE;&#x5F55;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x76EE;&#x5F55;" class="plugin-anchor" href="#&#x76EE;&#x5F55;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x76EE;&#x5F55;</h1>
<p><a href="#hw-1">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;forEach map filter reduce</a></p>
<p><a href="#hw-2">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684; Vue Reactive</a></p>
<p><a href="#hw-3">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;</a></p>
<p><a href="#hw-4">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;</a></p>
<p><a href="#hw-5">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;</a></p>
<p><a href="#hw-6">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;</a></p>
<p><a href="#hw-7">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;Promise</a></p>
<p><a href="#hw-8">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;instanceOf</a></p>
<p><a href="#hw-11">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;ajax</a></p>
<p><a href="#hw-12">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;JSONP&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;</a></p>
<p><a href="#hw-13">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;</a></p>
<p><a href="#hw-14">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;</a></p>
<p><a href="#hw-15">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; bind</a></p>
<p><a href="#hw-16">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; call</a></p>
<p><a href="#hw-17">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; apply</a></p>
<p><a href="#hw-18">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF; object.create</a></p>
<p><a href="#hw-19">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF; Object.is</a></p>
<p><a href="#hw-20">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; new </a></p>
<p><a href="#hw-21">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;</a></p>
<p><a href="#hw-22">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;</a></p>
<p><a href="#hw-23">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD; </a></p>
<p><a href="#hw-24">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0; async/await</a></p>
<p><a href="#hw-25">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;/&#x8BA2;&#x9605;&#x6A21;&#x5F0F;</a></p>
<p><a href="#hw-26">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x9632;&#x6296;</a></p>
<p><a href="#hw-27">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x8282;&#x6D41;</a></p>
<h1 id="&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;"><a name="&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;" class="anchor-navigation-ex-anchor" href="#&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;" class="plugin-anchor" href="#&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x624B;&#x5199;&#x4EE3;&#x7801;&#x9762;&#x8BD5;&#x771F;&#x9898;</h1>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;foreach-map-filter-reduce"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;foreach-map-filter-reduce" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;foreach-map-filter-reduce"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;foreach-map-filter-reduce" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;foreach-map-filter-reduce"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-1">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF1A;&#x5B9E;&#x73B0;forEach map filter reduce</p></h3>
<pre><code class="lang-javascript"> <span class="hljs-comment">// 1. ------_forEach--------</span>
    <span class="hljs-comment">// Array.prototype.forEach() &#x65B9;&#x6CD5;&#x5BF9;&#x6570;&#x7EC4;&#x7684;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x6267;&#x884C;&#x4E00;&#x6B21;&#x7ED9;&#x5B9A;&#x7684;&#x51FD;&#x6570;&#x3002;</span>
    <span class="hljs-comment">//  arr.forEach(callback(currentValue [, index [, array]])[, thisArg])</span>
    <span class="hljs-built_in">Array</span>.prototype._forEach = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">fn, thisArg</span>) </span>{
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> fn !== <span class="hljs-string">&apos;function&apos;</span>) <span class="hljs-keyword">throw</span> <span class="hljs-string">&apos;&#x53C2;&#x6570;&#x5FC5;&#x987B;&#x4E3A;&#x51FD;&#x6570;&apos;</span>
      <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">Array</span>.isArray(<span class="hljs-keyword">this</span>)) <span class="hljs-keyword">throw</span> <span class="hljs-string">&apos;&#x53EA;&#x80FD;&#x5BF9;&#x6570;&#x7EC4;&#x4F7F;&#x7528;&#x6B64;&#x65B9;&#x6CD5;&apos;</span>
      <span class="hljs-keyword">let</span> arr = <span class="hljs-keyword">this</span>
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; arr.length; i++) {
        fn.call(thisArg, arr[i], i, arr)  <span class="hljs-comment">//&#x7528;call&#x6765;&#x6539;&#x53D8;fn&#x91CC;&#x9762;this&#x7684;&#x6307;&#x5411;</span>
      }
    }
    <span class="hljs-comment">//test</span>
    <span class="hljs-comment">// window.value = 0</span>
    <span class="hljs-comment">// let obj = { value: 1 }</span>
    <span class="hljs-comment">// let arr = [&quot;_&quot;, &quot;for&quot;, &quot;each&quot;]</span>
    <span class="hljs-comment">// arr._forEach(</span>
    <span class="hljs-comment">//   function (ele, index, arr) {</span>
    <span class="hljs-comment">//     console.log(&quot;ele, index, arr&quot;, ele, index, arr);</span>
    <span class="hljs-comment">//     console.log(&quot;this.vaule&quot;, this.value);</span>
    <span class="hljs-comment">//   }, obj)</span>


    <span class="hljs-comment">// 2. ------_map--------</span>
    <span class="hljs-comment">// Array.prototype.map() &#x65B9;&#x6CD5;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x6570;&#x7EC4;&#xFF0C;&#x5176;&#x7ED3;&#x679C;&#x662F;&#x8BE5;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x662F;&#x8C03;&#x7528;&#x4E00;&#x6B21;&#x63D0;&#x4F9B;&#x7684;&#x51FD;&#x6570;&#x540E;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x3002;</span>
    <span class="hljs-comment">//  arr.map(callback(currentValue [, index [, array]])[, thisArg])</span>
    <span class="hljs-built_in">Array</span>.prototype._map = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">fn, thisArg</span>) </span>{
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> fn !== <span class="hljs-string">&apos;function&apos;</span>) <span class="hljs-keyword">throw</span> <span class="hljs-string">&quot;&#x53C2;&#x6570;&#x5FC5;&#x987B;&#x662F;&#x56DE;&#x8C03;&#x51FD;&#x6570;&quot;</span>
      <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">Array</span>.isArray(<span class="hljs-keyword">this</span>)) <span class="hljs-keyword">throw</span> <span class="hljs-string">&quot;&#x53EA;&#x80FD;&#x4E3A;&#x6570;&#x7EC4;&#x4F7F;&#x7528;&#x6B64;&#x65B9;&#x6CD5;&quot;</span>
      <span class="hljs-keyword">const</span> arr = <span class="hljs-keyword">this</span>      <span class="hljs-comment">//&#x5C06;&#x8C03;&#x7528;&#x8005;(&#x5B9E;&#x4F8B;&#x5316;&#x7684;arr)&#x8D4B;&#x503C;&#x7ED9;arr</span>
      <span class="hljs-keyword">const</span> newArr = []
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>, len = arr.length; i &lt; len; i++) {
        newArr.push(fn.call(thisArg, arr[i], i, arr))
        <span class="hljs-comment">//&#x5C06;&#x6BCF;&#x6B21;&#x8C03;&#x7528;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;fn&#x7684;&#x8FD4;&#x56DE;&#x503C;push&#x5230;&#x65B0;&#x6570;&#x7EC4;&#x4E2D;</span>
      }
      <span class="hljs-keyword">return</span> newArr  <span class="hljs-comment">//&#x8FD4;&#x56DE;&#x65B0;&#x6570;&#x7EC4;</span>
    }
    <span class="hljs-comment">//test</span>
    <span class="hljs-comment">// window.value = 0</span>
    <span class="hljs-comment">// let obj = { value: 1 }</span>
    <span class="hljs-comment">// let arr = [&quot;_&quot;, &quot;for&quot;, &quot;each&quot;]</span>
    <span class="hljs-comment">// const newArr = arr._map(</span>
    <span class="hljs-comment">//   function (ele, index) {</span>
    <span class="hljs-comment">//     return ele + &quot;&#x4F60;&#x597D;&quot; + index</span>
    <span class="hljs-comment">//   }, obj)</span>
    <span class="hljs-comment">// console.log(newArr);</span>


    <span class="hljs-comment">// 3. ------_filter--------</span>
    <span class="hljs-comment">// Array.prototype.map() &#x65B9;&#x6CD5;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x6570;&#x7EC4;, &#x5176;&#x5305;&#x542B;&#x901A;&#x8FC7;&#x6240;&#x63D0;&#x4F9B;&#x51FD;&#x6570;&#x5B9E;&#x73B0;&#x7684;&#x6D4B;&#x8BD5;&#x7684;&#x6240;&#x6709;&#x5143;&#x7D20;&#x3002; </span>
    <span class="hljs-comment">//  arr.filter(callback(currentValue [, index [, array]])[, thisArg])</span>
    <span class="hljs-built_in">Array</span>.prototype._filter = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">fn, thisArg</span>) </span>{
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> fn !== <span class="hljs-string">&apos;function&apos;</span>) <span class="hljs-keyword">throw</span> <span class="hljs-string">&quot;&#x53C2;&#x6570;&#x5FC5;&#x987B;&#x662F;&#x56DE;&#x8C03;&#x51FD;&#x6570;&quot;</span>
      <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">Array</span>.isArray(<span class="hljs-keyword">this</span>)) <span class="hljs-keyword">throw</span> <span class="hljs-string">&quot;&#x53EA;&#x80FD;&#x4E3A;&#x6570;&#x7EC4;&#x4F7F;&#x7528;&#x6B64;&#x65B9;&#x6CD5;&quot;</span>

      <span class="hljs-keyword">const</span> arr = <span class="hljs-keyword">this</span>      <span class="hljs-comment">//&#x5C06;&#x8C03;&#x7528;&#x8005;(&#x5B9E;&#x4F8B;&#x5316;&#x7684;arr)&#x8D4B;&#x503C;&#x7ED9;arr</span>
      <span class="hljs-keyword">const</span> newArr = []
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>, len = arr.length; i &lt; len; i++) {
        <span class="hljs-keyword">if</span> (fn.call(thisArg, arr[i], i, arr)) { <span class="hljs-comment">//&#x5224;&#x65AD;&#x56DE;&#x8C03;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x662F;&#x5426;&#x4E3A;true</span>
          newArr.push(arr[i])
        }
      }
      <span class="hljs-keyword">return</span> newArr  <span class="hljs-comment">//&#x8FD4;&#x56DE;&#x65B0;&#x6570;&#x7EC4;</span>
    }
    <span class="hljs-comment">//test</span>
    <span class="hljs-comment">// window.value = 0</span>
    <span class="hljs-comment">// let obj = { value: 1 }</span>
    <span class="hljs-comment">// let arr = [&quot;_&quot;, &quot;for&quot;, &quot;each&quot;]</span>
    <span class="hljs-comment">// const newArr = arr._filter(</span>
    <span class="hljs-comment">//   function (ele, index) {</span>
    <span class="hljs-comment">//     return ele == &quot;for&quot;</span>
    <span class="hljs-comment">//   }, obj)</span>
    <span class="hljs-comment">// console.log(newArr);</span>

    <span class="hljs-comment">//???????&#x4F20;&#x5165;&#x7684;&#x6570;&#x7EC4;&#x8FD9;&#x4E2A;&#x53C2;&#x6570;&#x7684;&#x4F5C;&#x7528;&#x662F;???????</span>


    <span class="hljs-comment">// 4. ------_reduce--------</span>
    <span class="hljs-comment">// Array.prototype.map() &#x65B9;&#x6CD5;&#x5BF9;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x6267;&#x884C;&#x4E00;&#x4E2A;&#x7531;&#x60A8;&#x63D0;&#x4F9B;&#x7684;reducer&#x51FD;&#x6570;(&#x5347;&#x5E8F;&#x6267;&#x884C;)&#xFF0C;&#x5C06;&#x5176;&#x7ED3;&#x679C;&#x6C47;&#x603B;&#x4E3A;&#x5355;&#x4E2A;&#x8FD4;&#x56DE;&#x503C;&#x3002;</span>
    <span class="hljs-comment">//  arr.reduce(callback(accumulator, currentValue[, index[, array]])[, initialValue])</span>
    <span class="hljs-built_in">Array</span>.prototype._reduce = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">_reducer, initialValue</span>) </span>{
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> _reducer !== <span class="hljs-string">&apos;function&apos;</span>) <span class="hljs-keyword">throw</span> <span class="hljs-string">&quot;&#x53C2;&#x6570;&#x5FC5;&#x987B;&#x662F;&#x56DE;&#x8C03;&#x51FD;&#x6570;&quot;</span>
      <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">Array</span>.isArray(<span class="hljs-keyword">this</span>)) <span class="hljs-keyword">throw</span> <span class="hljs-string">&quot;&#x53EA;&#x80FD;&#x4E3A;&#x6570;&#x7EC4;&#x4F7F;&#x7528;&#x6B64;&#x65B9;&#x6CD5;&quot;</span>
      <span class="hljs-keyword">if</span> ((!<span class="hljs-keyword">this</span>.length &amp;&amp; !initialValue)) <span class="hljs-keyword">throw</span> <span class="hljs-string">&quot;&#x8BF7;&#x4F20;&#x5165;&#x521D;&#x59CB;&#x503C;&#x6216;&#x8005;&#x7ED9;&#x975E;&#x7A7A;&#x5BF9;&#x8C61;&#x4F7F;&#x7528;&#x6B64;&#x65B9;&#x6CD5;&quot;</span>

      <span class="hljs-keyword">let</span> arr = <span class="hljs-keyword">this</span>    <span class="hljs-comment">//&#x5C06;&#x8C03;&#x7528;&#x8005;(&#x5B9E;&#x4F8B;&#x5316;&#x7684;arr)&#x8D4B;&#x503C;&#x7ED9;arr</span>
      <span class="hljs-keyword">let</span> result = initialValue || arr[<span class="hljs-number">0</span>]  <span class="hljs-comment">//&#x521D;&#x59CB;&#x503C;</span>
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>, len = arr.length; i &lt; len; i++) {
        <span class="hljs-keyword">if</span> (!initialValue &amp;&amp; i == <span class="hljs-number">0</span>) <span class="hljs-keyword">continue</span> <span class="hljs-comment">// &#x5982;&#x679C;&#x63D0;&#x4F9B;&#x4E86;initialValue&#xFF0C;&#x5219;&#x8D77;&#x59CB;&#x7D22;&#x5F15;&#x53F7;&#x4E3A;0&#xFF0C;&#x5426;&#x5219;&#x4ECE;&#x7D22;&#x5F15;1&#x8D77;&#x59CB;&#x3002;</span>
        result = _reducer(result, arr[i], i, <span class="hljs-keyword">this</span>)
      }
      <span class="hljs-keyword">return</span> result  <span class="hljs-comment">//&#x8FD4;&#x56DE;&#x65B0;&#x6570;&#x7EC4;</span>
    }

    <span class="hljs-comment">// //test</span>
    <span class="hljs-comment">// let arr = [1, 3, 4]</span>
    <span class="hljs-comment">// const Result = arr._reduce(function (accumulator, currentValue, index, array) {</span>
    <span class="hljs-comment">//   console.log(index);</span>
    <span class="hljs-comment">//   return accumulator + currentValue</span>
    <span class="hljs-comment">// }, 2)</span>
    <span class="hljs-comment">// console.log(Result);</span>
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684;-vue-reactive"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684;-vue-reactive" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684;-vue-reactive"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684;-vue-reactive" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684;-vue-reactive"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-2">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x7B80;&#x6613;&#x7684; Vue Reactive</p></h3>
<pre><code class="lang-javascript">

</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-3">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//&#x624B;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x76D1;&#x6D4B;&#x6570;&#x7EC4;&#x53D8;&#x5316;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x957F;&#x5EA6;</span>
<span class="hljs-comment">// &#x83B7;&#x53D6;Array&#x7684;&#x539F;&#x578B;&#xFF0C;&#x5E76;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x5BF9;&#x8C61;&#x6307;&#x5411;&#x8FD9;&#x4E2A;&#x539F;&#x578B;</span>
    <span class="hljs-comment">// const arrayMethods = Object.create(Array.prototype)</span>
    <span class="hljs-comment">// &#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x539F;&#x578B;&#xFF0C;&#x8FD9;&#x5C31;&#x662F;&#x6539;&#x9020;&#x4E4B;&#x540E;&#x7684;&#x6570;&#x7EC4;&#x539F;&#x578B;</span>
    <span class="hljs-keyword">const</span> ArrayProto = []
    <span class="hljs-comment">// &#x91CD;&#x65B0;&#x6784;&#x5EFA;Array&#x539F;&#x578B;&#x91CC;&#x9762;&#x7684;&#x867D;&#x6709;&#x65B9;&#x6CD5;</span>
    <span class="hljs-built_in">Object</span>.getOwnPropertyNames(<span class="hljs-built_in">Array</span>.prototype).forEach(method =&gt; {
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> <span class="hljs-built_in">Array</span>.prototype[method] === <span class="hljs-string">&quot;function&quot;</span>) {
        ArrayProto[method] = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{
          <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&quot;&#x6211;&#x5DF2;&#x7ECF;&#x76D1;&#x542C;&#x5230;&#x6570;&#x7EC4;&#x89E6;&#x53D1;&#x4E86;&quot;</span> + method + <span class="hljs-string">&quot;&#x4E8B;&#x4EF6;&quot;</span>)
          <span class="hljs-keyword">let</span> len = <span class="hljs-keyword">this</span>.length
          <span class="hljs-keyword">let</span> result = <span class="hljs-built_in">Array</span>.prototype[method].apply(<span class="hljs-keyword">this</span>, <span class="hljs-built_in">arguments</span>)
          <span class="hljs-built_in">console</span>.log(len, <span class="hljs-keyword">this</span>.length);
          <span class="hljs-keyword">if</span> (len !== <span class="hljs-keyword">this</span>.length) <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.length
          <span class="hljs-keyword">return</span> result
        }
      }
    })
    <span class="hljs-keyword">let</span> list = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>]
    <span class="hljs-comment">// &#x5C06;&#x6570;&#x7EC4;&#x7684;&#x539F;&#x578B;&#x94FE;&#x6307;&#x5411;&#x65B0;&#x6784;&#x9020;&#x7684;&#x539F;&#x578B;</span>
    list.__proto__ = ArrayProto
    <span class="hljs-comment">// &#x6267;&#x884C;push&#x4E8B;&#x4EF6;</span>
    <span class="hljs-built_in">console</span>.log(list.push(<span class="hljs-number">2</span>), list.pop(<span class="hljs-number">2</span>), list.slice(<span class="hljs-number">2</span>), list.unshift(<span class="hljs-number">2</span>));
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-4">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x539F;&#x751F;&#x7EE7;&#x627F;&#xFF0C;&#x5E76;&#x8BF4;&#x51FA;&#x5C40;&#x9650;&#x6027;&#xFF1F;</p></h3>
<pre><code class="lang-javascript">

</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-5">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//&#x67EF;&#x91CC;&#x5316;&#xFF1A;&#x56FA;&#x5B9A;&#x90E8;&#x5206;&#x53C2;&#x6570;&#xFF0C;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x63A5;&#x53D7;&#x5269;&#x4F59;&#x53C2;&#x6570;&#x7684;&#x51FD;&#x6570;&#xFF0C;&#x4E5F;&#x79F0;&#x4E3A;&#x90E8;&#x5206;&#x8BA1;&#x7B97;&#x51FD;&#x6570;&#xFF0C;&#x76EE;&#x7684;&#x662F;&#x4E3A;&#x4E86;&#x7F29;&#x5C0F;&#x9002;&#x7528;&#x8303;&#x56F4;&#xFF0C;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x9488;&#x5BF9;&#x6027;&#x66F4;&#x5F3A;&#x7684;&#x51FD;&#x6570;&#x3002;&#x6838;&#x5FC3;&#x601D;&#x60F3;&#x662F;&#x628A;&#x591A;&#x53C2;&#x6570;&#x4F20;&#x5165;&#x7684;&#x51FD;&#x6570;&#x62C6;&#x6210;&#x5355;&#x53C2;&#x6570;&#xFF08;&#x6216;&#x90E8;&#x5206;&#xFF09;&#x51FD;&#x6570;&#xFF0C;&#x5185;&#x90E8;&#x518D;&#x8FD4;&#x56DE;&#x8C03;&#x7528;&#x4E0B;&#x4E00;&#x4E2A;&#x5355;&#x53C2;&#x6570;&#xFF08;&#x6216;&#x90E8;&#x5206;&#xFF09;&#x51FD;&#x6570;&#xFF0C;&#x4F9D;&#x6B21;&#x5904;&#x7406;&#x5269;&#x4F59;&#x7684;&#x53C2;&#x6570;&#x3002;</span>
<span class="hljs-comment">//&#x597D;&#x5904;&#xFF1A; &#x5165;&#x53E3;&#x5355;&#x4E00;&#xFF0C;&#x6613;&#x4E8E;&#x6D4B;&#x8BD5;&#x548C;&#x590D;&#x7528;  </span>
<span class="hljs-comment">//&#x7F3A;&#x70B9;&#xFF1A;  &#x51FD;&#x6570;&#x5D4C;&#x5957;&#x591A;&#x3001;&#x5360;&#x5185;&#x5B58;</span>


<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Curry</span>(<span class="hljs-params">fn,...args</span>)</span>{
    <span class="hljs-keyword">return</span> (..._args)=&gt;{
        <span class="hljs-keyword">return</span> fn(...args,..._args))
    }
}


<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">V</span>(<span class="hljs-params">l,w,h</span>)</span>{
    <span class="hljs-keyword">return</span> l*w*h
}

<span class="hljs-keyword">const</span> hcy =Curry(V,<span class="hljs-number">10</span>)
hcy(<span class="hljs-number">5</span>,<span class="hljs-number">8</span>)   <span class="hljs-comment">//400</span>
hcy(<span class="hljs-number">6</span>,<span class="hljs-number">7</span>)   <span class="hljs-comment">//420</span>
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-6">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;&#x53CD;&#x67EF;&#x91CC;&#x5316;&#x51FD;&#x6570;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//&#x53CD;&#x67EF;&#x91CC;&#x5316;&#xFF0C;&#x4ECE;&#x5B57;&#x9762;&#x8BB2;&#xFF0C;&#x610F;&#x4E49;&#x548C;&#x7528;&#x6CD5;&#x8DDF;&#x51FD;&#x6570;&#x67EF;&#x91CC;&#x5316;&#x76F8;&#x6BD4;&#x6B63;&#x597D;&#x76F8;&#x53CD;&#xFF0C;&#x6269;&#x5927;&#x9002;&#x7528;&#x8303;&#x56F4;&#xFF0C;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x5E94;&#x7528;&#x8303;&#x56F4;&#x66F4;&#x5E7F;&#x7684;&#x51FD;&#x6570;&#x3002;&#x4F7F;&#x672C;&#x6765;&#x53EA;&#x6709;&#x7279;&#x5B9A;&#x5BF9;&#x8C61;&#x624D;&#x9002;&#x7528;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x6269;&#x5C55;&#x5230;&#x66F4;&#x591A;&#x7684;&#x5BF9;&#x8C61;&#x3002;</span>
<span class="hljs-built_in">Function</span>.prototype.unCurrying = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> self = <span class="hljs-keyword">this</span>
  <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">...rest</span>) </span>{
    <span class="hljs-keyword">return</span> <span class="hljs-built_in">Function</span>.prototype.call.apply(self, rest)
  }
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;promise"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;promise" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;promise"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;promise" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;promise"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-7">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;Promise</p></h3>
<pre><code class="lang-javascript"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Promise</span></span>{
  <span class="hljs-keyword">constructor</span>(executor){
    <span class="hljs-keyword">this</span>.state = <span class="hljs-string">&apos;pending&apos;</span>;
    <span class="hljs-keyword">this</span>.value = <span class="hljs-literal">undefined</span>;
    <span class="hljs-keyword">this</span>.reason = <span class="hljs-literal">undefined</span>;
    <span class="hljs-keyword">this</span>.onResolvedCallbacks = [];
    <span class="hljs-keyword">this</span>.onRejectedCallbacks = [];

    <span class="hljs-keyword">try</span>{  <span class="hljs-comment">// &#x5982;&#x679C;executor&#x6267;&#x884C;&#x62A5;&#x9519;&#xFF0C;&#x76F4;&#x63A5;&#x6267;&#x884C;reject</span>
      executor(<span class="hljs-keyword">this</span>.resolve, <span class="hljs-keyword">this</span>.reject);
    } <span class="hljs-keyword">catch</span> (err) {
      reject(err);
    }
  }

    <span class="hljs-comment">//&#x6210;&#x529F;</span>
    resolv(value){
      <span class="hljs-comment">// state&#x6539;&#x53D8;,resolve&#x8C03;&#x7528;&#x5C31;&#x4F1A;&#x5931;&#x8D25;</span>
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.state === <span class="hljs-string">&apos;pending&apos;</span>) {
        <span class="hljs-comment">// resolve&#x8C03;&#x7528;&#x540E;&#xFF0C;state&#x8F6C;&#x5316;&#x4E3A;&#x6210;&#x529F;&#x6001;</span>
        <span class="hljs-keyword">this</span>.state = <span class="hljs-string">&apos;fulfilled&apos;</span>;
        <span class="hljs-comment">// &#x50A8;&#x5B58;&#x6210;&#x529F;&#x7684;&#x503C;</span>
        <span class="hljs-keyword">this</span>.value = value;
      }
    };
    <span class="hljs-comment">//&#x5931;&#x8D25;</span>
    reject(reason) {
      <span class="hljs-comment">// state&#x6539;&#x53D8;,reject&#x8C03;&#x7528;&#x5C31;&#x4F1A;&#x5931;&#x8D25;</span>
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.state === <span class="hljs-string">&apos;pending&apos;</span>) {
        <span class="hljs-comment">// reject&#x8C03;&#x7528;&#x540E;&#xFF0C;state&#x8F6C;&#x5316;&#x4E3A;&#x5931;&#x8D25;&#x6001;</span>
        <span class="hljs-keyword">this</span>.state = <span class="hljs-string">&apos;rejected&apos;</span>;
        <span class="hljs-comment">// &#x50A8;&#x5B58;&#x5931;&#x8D25;&#x7684;&#x539F;&#x56E0;</span>
        <span class="hljs-keyword">this</span>.reason = reason;
      }
    };

    <span class="hljs-comment">//then&#x65B9;&#x6CD5;</span>
     then(onFulfilled,onRejected) {
    <span class="hljs-comment">// &#x58F0;&#x660E;&#x8FD4;&#x56DE;&#x7684;promise2</span>
    <span class="hljs-keyword">let</span> promise2 = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Promise</span>((resolve, reject)=&gt;{
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.state === <span class="hljs-string">&apos;fulfilled&apos;</span>) {
        <span class="hljs-keyword">let</span> x = onFulfilled(<span class="hljs-keyword">this</span>.value);
        <span class="hljs-comment">// resolvePromise&#x51FD;&#x6570;&#xFF0C;&#x5904;&#x7406;&#x81EA;&#x5DF1;return&#x7684;promise&#x548C;&#x9ED8;&#x8BA4;&#x7684;promise2&#x7684;&#x5173;&#x7CFB;</span>
        resolvePromise(promise2, x, resolve, reject);
      };
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.state === <span class="hljs-string">&apos;rejected&apos;</span>) {
        <span class="hljs-keyword">let</span> x = onRejected(<span class="hljs-keyword">this</span>.reason);
        resolvePromise(promise2, x, resolve, reject);
      };
      <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.state === <span class="hljs-string">&apos;pending&apos;</span>) {
        <span class="hljs-keyword">this</span>.onResolvedCallbacks.push(()=&gt;{
          <span class="hljs-keyword">let</span> x = onFulfilled(<span class="hljs-keyword">this</span>.value);
          resolvePromise(promise2, x, resolve, reject);
        })
        <span class="hljs-keyword">this</span>.onRejectedCallbacks.push(()=&gt;{
          <span class="hljs-keyword">let</span> x = onRejected(<span class="hljs-keyword">this</span>.reason);
          resolvePromise(promise2, x, resolve, reject);
        })
      }
    });
    <span class="hljs-comment">// &#x8FD4;&#x56DE;promise&#xFF0C;&#x5B8C;&#x6210;&#x94FE;&#x5F0F;</span>
    <span class="hljs-keyword">return</span> promise2;
  }
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;instanceof"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;instanceof" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;instanceof"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;instanceof" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x4E00;&#x4E2A;instanceof"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-8">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x4E00;&#x4E2A;instanceOf</p></h3>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">instanceOf</span>(<span class="hljs-params">left,right</span>)</span>{
    <span class="hljs-keyword">let</span> proto = left.__proto__
    <span class="hljs-keyword">let</span> prototype = right.prototype
    <span class="hljs-keyword">while</span>(<span class="hljs-literal">true</span>){
        <span class="hljs-keyword">if</span>(proto === <span class="hljs-literal">null</span>) <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>
        <span class="hljs-keyword">if</span>(proto === prototype) <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span> 
        proto = proto.__proto__;
    }
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;ajax"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;ajax" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;ajax"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;ajax" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;ajax"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-11">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;ajax</p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//1.&#x521B;&#x5EFA;&#x5BF9;&#x8C61;</span>
<span class="hljs-keyword">let</span>  xhq = <span class="hljs-keyword">new</span> XMLHttpRequest()
<span class="hljs-comment">//2.&#x521D;&#x59CB;&#x8BDD;http&#x8BF7;&#x6C42;&#x53C2;&#x6570;</span>
xhq.open(methode, url, <span class="hljs-literal">true</span>)
<span class="hljs-comment">//3.&#x53D1;&#x9001;&#x8BF7;&#x6C42;</span>
xhq.send({
    username:<span class="hljs-string">&apos;wzx&apos;</span>
})
<span class="hljs-comment">//4.&#x76D1;&#x542C;&#x8BF7;&#x6C42;&#x72B6;&#x6001;,&#x6267;&#x884C;&#x5BF9;&#x5E94;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;</span>
xhq.onreadystatechange = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">if</span> ( xhq.readystate == <span class="hljs-number">4</span> &amp;&amp; xhq.status == <span class="hljs-number">200</span> ) {
        <span class="hljs-comment">// success &#x56DE;&#x8C03;</span>
        success(xhq.responseText)
    }  <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (xhq.readyState == <span class="hljs-number">4</span> &amp;&amp; xhq.status !== <span class="hljs-number">200</span>) {
        <span class="hljs-comment">// error &#x56DE;&#x8C03;</span>
        error()
    }
}


<span class="hljs-comment">//-----------&#x5B8C;&#x6574;&#x5B9E;&#x73B0;-----------</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sendAjax</span>(<span class="hljs-params">obj</span>) </span>{
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">splicStr</span>(<span class="hljs-params">data</span>) </span>{<span class="hljs-comment">// get&#x65B9;&#x5F0F;&#x4F20;&#x5165;&#x65F6;&#xFF0C;&#x5C06;&#x5185;&#x5BB9;&#x8FDB;&#x884C;data&#x5185;&#x5BB9;&#x8FDB;&#x884C;&#x62FC;&#x63A5;</span>
        <span class="hljs-keyword">var</span> str = <span class="hljs-string">&apos;&apos;</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-keyword">in</span> data) {
            str = i + <span class="hljs-string">&apos;=&apos;</span> + data[i]
        }
        <span class="hljs-keyword">return</span> str
    }

<span class="hljs-comment">// &#x539F;&#x751F;ajax&#x5B9E;&#x73B0; &#x6B65;&#x9AA4;&#x5206;&#x6790;</span>
<span class="hljs-comment">// &#x4E00;&#x3001;&#x58F0;&#x660E;XMLHttpRequest, &#x4E3A;&#x4E86;&#x517C;&#x5BB9;IE5&#x3001;6&#x9700;&#x8981;&#x4F7F;&#x7528;ActiveXObject()</span>
    <span class="hljs-keyword">let</span> xhq = <span class="hljs-keyword">new</span> XMLHttpRequest() <span class="hljs-comment">// &#x521B;&#x5EFA;&#x5BF9;&#x8C61;</span>
<span class="hljs-comment">// &#x4E8C;&#x3001;&#x521D;&#x59CB;&#x5316;HTTP&#x8BF7;&#x6C42;&#x53C2;&#x6570;&#xFF0C; &#x53EA;&#x521D;&#x59CB;&#x5316;&#x5E76;&#x4E0D;&#x4F1A;&#x53D1;&#x9001;</span>
    <span class="hljs-keyword">if</span> (obj.method.toUpperCase() === <span class="hljs-string">&apos;GET&apos;</span>) { <span class="hljs-comment">// get&#x65B9;&#x6CD5;</span>
        xhq.open(obj.method, obj.url + <span class="hljs-string">&apos;?&apos;</span> + splicStr(obj.data),  <span class="hljs-keyword">typeof</span> obj.async === <span class="hljs-string">&apos;boolean&apos;</span>? obj.async : <span class="hljs-literal">true</span>) <span class="hljs-comment">// &#x8DEF;&#x5F84;&#x62FC;&#x63A5;</span>
        xhq.send()<span class="hljs-comment">// &#x4E09;&#x3001;&#x53D1;&#x9001;&#x6B64;&#x6B21;&#x8BF7;&#x6C42;</span>
    }
    <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (obj.method.toUpperCase() === <span class="hljs-string">&apos;POST&apos;</span>) { <span class="hljs-comment">// post&#x65B9;&#x6CD5;</span>
        xhq.open(obj.method, obj.url, <span class="hljs-keyword">typeof</span> obj.async === <span class="hljs-string">&apos;boolean&apos;</span>? obj.async : <span class="hljs-literal">true</span>)
        xhq.setRequestHeader(<span class="hljs-string">&quot;content-type&quot;</span>,<span class="hljs-string">&quot;application/x-www-form-urlencoded&quot;</span>) <span class="hljs-comment">// &#x4EE5;&#x8868;&#x5355;&#x63D0;&#x4EA4;</span>
        xhq.send(obj.data)<span class="hljs-comment">// &#x4E09;&#x3001;&#x53D1;&#x9001;&#x6B64;&#x6B21;&#x8BF7;&#x6C42;</span>
    }
<span class="hljs-comment">//&#x56DB;&#x3001;&#x76D1;&#x542C;&#x53D1;&#x9001;</span>
    xhq.onreadystatechange = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{
        <span class="hljs-keyword">if</span> ( xhq.readyState == <span class="hljs-number">4</span> &amp;&amp; xhq.status == <span class="hljs-number">200</span> ) {
            <span class="hljs-comment">// success &#x56DE;&#x8C03;</span>
            success(xhq.responseText)
        } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (xhq.readyState == <span class="hljs-number">4</span> &amp;&amp; xhq.status !== <span class="hljs-number">200</span>) {
            <span class="hljs-comment">// error &#x56DE;&#x8C03;</span>
            error()
        }
    }
}

sendAjax({
    url: <span class="hljs-string">&apos;your url&apos;</span>,
    method: <span class="hljs-string">&apos;post&apos;</span>,
    <span class="hljs-keyword">async</span>: <span class="hljs-literal">true</span>,
    data: {
        username: <span class="hljs-string">&apos;xiong&apos;</span>,
        pwd: <span class="hljs-string">&apos;123&apos;</span>
    },
    success: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">data</span>) </span>{
        <span class="hljs-built_in">console</span>.log(data)
    },
    error: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{
        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x53D1;&#x751F;&#x4E86;&#x9519;&#x8BEF;&apos;</span>)
    }
})
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;jsonp&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;jsonp&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;jsonp&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;jsonp&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;jsonp&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-12">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;JSONP&#x7684;&#x539F;&#x7406;&#x548C;&#x5B9E;&#x73B0;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">jsonp</span>(<span class="hljs-params">url,data,callback</span>)</span>{
    <span class="hljs-keyword">var</span> funcName = <span class="hljs-string">&apos;jsonp_&apos;</span>+<span class="hljs-built_in">Date</span>.now()+<span class="hljs-built_in">Math</span>.random().toString().substr(<span class="hljs-number">2</span>, <span class="hljs-number">5</span>)
    <span class="hljs-comment">//&#x5982;&#x679C;&#x6709;&#x5176;&#x4ED6;&#x53C2;&#x6570;&#x9700;&#x8981;&#x62FC;&#x63A5;</span>
    <span class="hljs-keyword">if</span>(<span class="hljs-keyword">typeof</span> data===<span class="hljs-string">&apos;object&apos;</span>){
        <span class="hljs-keyword">var</span> tmpArr = []
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> key <span class="hljs-keyword">in</span> data){
            <span class="hljs-keyword">let</span> value =data[key]
            tmpArr.push(key+<span class="hljs-string">&apos;=&apos;</span>+value)
        }
        data = tmpArr.join(<span class="hljs-string">&apos;&amp;&apos;</span>)
    }
    <span class="hljs-keyword">let</span> script = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">&apos;script&apos;</span>)
    script.src = url + <span class="hljs-string">&apos;?&apos;</span> + data + <span class="hljs-string">&apos;&amp;callback= &apos;</span> + funcName
    <span class="hljs-built_in">document</span>.body.appendChild(script)
    <span class="hljs-built_in">window</span>[funcName]= <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">data</span>)</span>{
        callback(data)
        <span class="hljs-comment">//&#x6E05;&#x9664;&#x6807;&#x7B7E;</span>
        <span class="hljs-keyword">delete</span> Window[funcName]
        <span class="hljs-built_in">document</span>.body.removeChild(script)
    }
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-13">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6DF1;&#x62F7;&#x8D1D;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//&#x4E5E;&#x4E10;&#x7248;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">deepCopy</span>(<span class="hljs-params">obj</span>)</span>{
    <span class="hljs-keyword">return</span> obj.JSON.Parse(<span class="hljs-built_in">JSON</span>.Stringify(obj))
}

<span class="hljs-comment">//&#x9762;&#x8BD5;&#x591F;&#x7528;&#x7248;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">deepCopy</span>(<span class="hljs-params">obj</span>)</span>{
    <span class="hljs-keyword">if</span>(<span class="hljs-keyword">typeof</span> obj)
    <span class="hljs-keyword">if</span>(<span class="hljs-keyword">typeof</span> obj ==<span class="hljs-string">&apos;object&apos;</span>){<span class="hljs-comment">//&#x5224;&#x65AD;&#x662F;&#x5426;&#x4E3A;&#x590D;&#x6742;&#x6570;&#x636E;&#x6E90;&#x7C7B;&#x578B;</span>
        <span class="hljs-keyword">var</span> result = obj.constructor == <span class="hljs-built_in">Array</span>?[]:{}  <span class="hljs-comment">//&#x6570;&#x7EC4;&#x8FD8;&#x662F;&#x5BF9;&#x8C61;</span>
        <span class="hljs-keyword">for</span>(<span class="hljs-keyword">let</span> i <span class="hljs-keyword">in</span> obj){
            result[i]= <span class="hljs-keyword">typeof</span> obj[i] ==<span class="hljs-string">&apos;object&apos;</span>? deepCopy(obj[i]):obj[i]
        }
    }<span class="hljs-keyword">else</span>{
        <span class="hljs-comment">//&#x7B80;&#x5355;&#x6570;&#x636E;&#x7C7B;&#x578B; </span>
        <span class="hljs-keyword">var</span> result = obj;
    }
    <span class="hljs-keyword">return</span> result
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-14">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6D45;&#x62F7;&#x8D1D;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">clone</span>(<span class="hljs-params">target</span>) </span>{
    <span class="hljs-keyword">if</span>(target === <span class="hljs-literal">null</span> ) {
        <span class="hljs-keyword">return</span> target
    }
    <span class="hljs-comment">// &#x514B;&#x9686; &#x6570;&#x7EC4; &#x548C; &#x5BF9;&#x8C61;</span>
    <span class="hljs-keyword">let</span> cloneTarget = <span class="hljs-built_in">Array</span>.isArray(target) ? [] : {}
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> key <span class="hljs-keyword">in</span> target) {
        <span class="hljs-keyword">if</span> (target.hasOwnProperty(key)) {<span class="hljs-comment">//&#x5224;&#x65AD;&#x662F;&#x5426;&#x662F;&#x672C;&#x8EAB;&#x7684;&#x5C5E;&#x6027;</span>
            cloneTarget[key] = target[key]
        }
    }
    <span class="hljs-keyword">return</span> cloneTarget
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-bind"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-bind" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-bind"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-bind" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-bind"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-15">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; bind</p></h3>
<pre><code class="lang-javascript"><span class="hljs-built_in">Function</span>.prototype.myBind = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">context</span>) </span>{
    <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> <span class="hljs-keyword">this</span> !== <span class="hljs-string">&apos;function&apos;</span>) {
        <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">TypeError</span>(<span class="hljs-string">&apos;Error&apos;</span>)
    }
    <span class="hljs-comment">//&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x7ED1;&#x5B9A;this&#x7684;&#x51FD;&#x6570;&#xFF0C;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4FDD;&#x5B58;this</span>
    <span class="hljs-keyword">const</span> _this = <span class="hljs-keyword">this</span>
    <span class="hljs-keyword">const</span> args = [...arguments].slice(<span class="hljs-number">1</span>)
        <span class="hljs-comment">//&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x51FD;&#x6570;</span>
    <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">F</span>(<span class="hljs-params"></span>) </span>{
        <span class="hljs-comment">//&#x56E0;&#x4E3A;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;new F()&#x9700;&#x8981;&#x5224;&#x65AD;&#x80FD;&#x5F53;&#x505A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x5417;</span>
        <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span> <span class="hljs-keyword">instanceof</span> F) { <span class="hljs-comment">//&#x5B9E;&#x4F8B;&#x662F;F&#x8FD9;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x9020;&#x51FA;&#x6765;&#x7684;</span>
            <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> _this(...args, ...arguments)  
        }
        <span class="hljs-keyword">return</span> _this.apply(context, args.concat(...arguments))
    }
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-call"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-call" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-call"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-call" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-call"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-16">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; call</p></h3>
<pre><code class="lang-javascript"><span class="hljs-built_in">Function</span>.prototype.myCall = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">context</span>) </span>{
    context=context||<span class="hljs-built_in">window</span> <span class="hljs-comment">//&#x4F20;&#x5165;&#x53C2;&#x6570;&#x7684;&#x8BDD;&#xFF0C;&#x5C31;&#x6307;&#x5B9A;context&#x4E3A;this&#x6307;&#x5411;&#xFF0C;&#x5426;&#x5219;&#x6307;&#x5B9A;window</span>
    context.fn = <span class="hljs-keyword">this</span>
    <span class="hljs-keyword">const</span> args = [...arguments].slice(<span class="hljs-number">1</span>) <span class="hljs-comment">//&#x5165;&#x53C2;&#x5220;&#x9664;context</span>
    <span class="hljs-keyword">const</span> result = context.fn(...args)
    <span class="hljs-keyword">delete</span> context.fn
    <span class="hljs-keyword">return</span> result
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-apply"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-apply" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-apply"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-apply" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-apply"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-17">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; apply</p></h3>
<pre><code class="lang-javascript"><span class="hljs-built_in">Function</span>.prototype.myApply = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">context</span>) </span>{
   context = context || <span class="hljs-built_in">window</span>
   context.fn = <span class="hljs-keyword">this</span>   <span class="hljs-comment">//&#x7ED9;&#x4F20;&#x5165;&#x7684;&#x4E0A;&#x4E0B;&#x6587;&#x5BF9;&#x8C61;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;fn&#x65B9;&#x6CD5;&#xFF0C;&#x8FD9;&#x4E2A;fn&#x65B9;&#x6CD5;&#x5373;&#x4E3A;myApply&#x8C03;&#x7528;&#x8005;</span>
   <span class="hljs-keyword">let</span> result 
   <span class="hljs-keyword">if</span>(<span class="hljs-built_in">arguments</span>[<span class="hljs-number">1</span>]){
       result = context.fn(...arguments[<span class="hljs-number">1</span>])
   }<span class="hljs-keyword">else</span>{
       result = context.fn()
   }
    <span class="hljs-keyword">delete</span> context.fn
    <span class="hljs-keyword">return</span> result
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectcreate"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectcreate" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectcreate"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectcreate" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectcreate"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-18">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF; object.create</p></h3>
<pre><code>function _create (obj){
    function F(){}  //&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;
    F.prototype = obj  //&#x5C06;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x8D4B;&#x503C;
    return new F()
}
</code></pre><h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectis"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectis" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectis"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectis" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;-objectis"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-19">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF; Object.is</p></h3>
<pre><code>function _is(x, y) {
    if (x === y) {
        //&#x8FD0;&#x884C;&#x5230;1/x === 1/y&#x7684;&#x65F6;&#x5019;x&#x548C;y&#x90FD;&#x4E3A;0&#xFF0C;&#x4F46;&#x662F;1/+0 = +Infinity&#xFF0C; 1/-0 = -Infinity, &#x662F;&#x4E0D;&#x4E00;&#x6837;&#x7684;
        return x !== 0 || y !== 0 || 1 / x === 1 / y
    } else {
        //NaN===NaN&#x662F;false,&#x8FD9;&#x662F;&#x4E0D;&#x5BF9;&#x7684;&#xFF0C;&#x6211;&#x4EEC;&#x5728;&#x8FD9;&#x91CC;&#x505A;&#x4E00;&#x4E2A;&#x62E6;&#x622A;&#xFF0C;x !== x&#xFF0C;&#x90A3;&#x4E48;&#x4E00;&#x5B9A;&#x662F; NaN, y &#x540C;&#x7406;
        //&#x4E24;&#x4E2A;&#x90FD;&#x662F;NaN&#x7684;&#x65F6;&#x5019;&#x8FD4;&#x56DE;true
        return x !== x &amp;&amp; y !== y
    }
}

console.log(is(+0, -0))
console.log(is(NaN, NaN))
</code></pre><h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-new-"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-new-" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-new-"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-new-" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;-new-"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-20">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199; new </p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//new&#x7684;&#x5B9E;&#x73B0;&#x8FC7;&#x7A0B;(&#x5B9E;&#x9645;&#x4E0A;&#x5C31;&#x662F;&#x8C03;&#x7528;&#x8FD9;&#x4E2A;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x540C;&#x65F6;&#x5C06;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;prototype&#x4E0A;&#x7684;&#x5C5E;&#x6027;&#x65B9;&#x6CD5;&#x6302;&#x4E0A;&#x53BB;&#x3002;)</span>
<span class="hljs-comment">//1. &#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;</span>
<span class="hljs-comment">//2. &#x5BF9;&#x8C61; &#x7EE7;&#x627F; &#x6784;&#x9020;&#x51FD;&#x6570;&#x7684; &#x539F;&#x578B;&#x94FE;</span>
<span class="hljs-comment">//3. &#x5C06;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;this&#x6307;&#x5411;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;</span>
<span class="hljs-comment">//4. &#x6839;&#x636E;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x7684;&#x8FD4;&#x56DE;&#x7ED3;&#x6784;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">myNew</span>(<span class="hljs-params">fn</span>)</span>{ 
    <span class="hljs-keyword">let</span> obj = {} <span class="hljs-comment">//&#x5B9A;&#x4E49;&#x7A7A;&#x5BF9;&#x8C61;obj</span>
    obj = <span class="hljs-built_in">Object</span>.create(fn.prototype) <span class="hljs-comment">//&#x5C06;&#x4F20;&#x5165;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;prototype&#x5C5E;&#x6027;&#x65B9;&#x6CD5;&#x590D;&#x5236;&#x5230;obj&#x91CC;&#x9762;</span>
    <span class="hljs-keyword">let</span> args = <span class="hljs-built_in">Array</span>.prototype.slice.call(<span class="hljs-built_in">arguments</span>,<span class="hljs-number">1</span>)<span class="hljs-comment">// &#x83B7;&#x53D6;&#x9664;&#x53BB;fn&#x4E4B;&#x5916;&#x7684;&#x53C2;&#x6570;</span>
    <span class="hljs-comment">//&#x6216;&#x8005;  [...arguments].slice(1)</span>
    <span class="hljs-keyword">let</span> result = fn.call(obj,...args)  <span class="hljs-comment">// &#x8C03;&#x7528;&#x4F20;&#x5165;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;,&#x77EB;&#x6B63;this&#x4E3A;obj&#xFF0C;&#x5E76;&#x4F20;&#x5165;args</span>
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">typeof</span> result === <span class="hljs-string">&apos;object&apos;</span>||result <span class="hljs-keyword">instanceof</span> <span class="hljs-built_in">Function</span>? result : obj;
    <span class="hljs-comment">//&#x5982;&#x679C;&#x6784;&#x9020;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x5F15;&#x7528;&#x7C7B;&#x578B;&#xFF0C;&#x76F4;&#x63A5;&#x8FD4;&#x56DE;&#xFF0C;&#x5426;&#x5219;&#x8FD4;&#x56DE;obj</span>
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span></span>{
    <span class="hljs-keyword">constructor</span>(){
    <span class="hljs-keyword">this</span>.name = <span class="hljs-string">&apos;ciel&apos;</span>
    <span class="hljs-keyword">this</span>.arg = <span class="hljs-built_in">arguments</span>[<span class="hljs-number">0</span>]
    }
    callname(){
        <span class="hljs-built_in">console</span>.log(<span class="hljs-keyword">this</span>.name)
    }
}

<span class="hljs-comment">// &#x6D4B;&#x8BD5;</span>
<span class="hljs-keyword">let</span> test = myNew(Foo, <span class="hljs-string">&apos;hhh&apos;</span>, <span class="hljs-string">&apos;123&apos;</span>, <span class="hljs-string">&apos;saf&apos;</span>)
test.callName()
<span class="hljs-built_in">console</span>.log(test.arg)
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-21">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5BF9;&#x8C61;&#x6241;&#x5E73;&#x5316;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-keyword">export</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">jsonFlatten</span>(<span class="hljs-params">data</span>) </span>{
  <span class="hljs-keyword">var</span> result = {}
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">recurse</span>(<span class="hljs-params">cur, prop</span>) </span>{
    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">Object</span>(cur) !== cur) {
      result[prop] = cur
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (<span class="hljs-built_in">Array</span>.isArray(cur)) {
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>, l = cur.length; i &lt; l; i++) { recurse(cur[i], prop + <span class="hljs-string">&apos;[&apos;</span> + i + <span class="hljs-string">&apos;]&apos;</span>) }
      <span class="hljs-keyword">if</span> (l === <span class="hljs-number">0</span>) { result[prop] = [] }
    } <span class="hljs-keyword">else</span> {
      <span class="hljs-keyword">var</span> isEmpty = <span class="hljs-literal">true</span>
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> p <span class="hljs-keyword">in</span> cur) {
        isEmpty = <span class="hljs-literal">false</span>
        recurse(cur[p], prop ? prop + <span class="hljs-string">&apos;.&apos;</span> + p : p)
      }
      <span class="hljs-keyword">if</span> (isEmpty &amp;&amp; prop) { result[prop] = {} }
    }
  }
  recurse(data, <span class="hljs-string">&apos;&apos;</span>)
  <span class="hljs-keyword">return</span> result
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-22">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6570;&#x7EC4;&#x6241;&#x5E73;&#x5316;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//&#x7B2C;&#x4E00;&#x79CD; &#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">flatten</span>(<span class="hljs-params">arr</span>)</span>{
    <span class="hljs-keyword">let</span> str = <span class="hljs-built_in">JSON</span>.stringify(arr);
    <span class="hljs-keyword">return</span> str.replace(<span class="hljs-regexp">/(\[\]))/g</span>,<span class="hljs-string">&apos;&apos;</span>).split(<span class="hljs-string">&apos;,&apos;</span>)
}
<span class="hljs-comment">//&#x7B2C;&#x4E8C;&#x79CD; &#x9012;&#x5F52;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">flatten</span>(<span class="hljs-params">arr, result = []</span>) </span>{
  <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">Array</span>.isArray(arr)) {
    result.push(arr)
    <span class="hljs-keyword">return</span> result
  }
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> value <span class="hljs-keyword">of</span> arr) {
    flatten(value, result)
  }
  <span class="hljs-keyword">return</span> result
}
<span class="hljs-comment">//&#x7B2C;&#x4E09;&#x79CD; &#x6570;&#x7EC4;&#x5B57;&#x7B26;&#x4E32;&#x65B9;&#x6CD5;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">flatten</span>(<span class="hljs-params">arr</span>) </span>{
  <span class="hljs-keyword">return</span> arr.toString().split(<span class="hljs-string">&apos;,&apos;</span>).map(ele =&gt; <span class="hljs-built_in">parseInt</span>(ele))
}

<span class="hljs-comment">//&#x7B2C;&#x56DB;&#x79CD;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">flatten</span>(<span class="hljs-params">arr</span>)</span>{
  <span class="hljs-keyword">while</span>(arr.some(item =&gt; <span class="hljs-built_in">Array</span>.isArray(item))){
    arr = [].concat(...arr);
  }
  <span class="hljs-keyword">return</span> arr;
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD;-"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD;-" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD;-"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD;-" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD;-"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-23">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6570;&#x7EC4;&#x53BB;&#x91CD; </p></h3>
<pre><code class="lang-javascript"><span class="hljs-comment">//1.ES6&#x7684;Set</span>
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unique</span>(<span class="hljs-params">arr</span>)</span>{
      ruturn <span class="hljs-built_in">Array</span>.from(<span class="hljs-keyword">new</span> <span class="hljs-built_in">Set</span>(arr))   
  }
<span class="hljs-comment">//2. &#x53CC;&#x5C42;for&#x5FAA;&#x73AF;</span>
   <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unique</span>(<span class="hljs-params">arr</span>) </span>{
      <span class="hljs-keyword">let</span> result = []
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>, len = arr.length; i &lt; len; i++) { <span class="hljs-comment">//&#x7B2C;&#x4E00;&#x5C42;&#x904D;&#x5386;</span>
        <span class="hljs-keyword">let</span> flag = <span class="hljs-literal">false</span>  <span class="hljs-comment">//&#x8FDB;&#x884C;&#x6807;&#x8BB0;</span>
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> k = i + <span class="hljs-number">1</span>, len = arr.length; k &lt; len; k++) {
          <span class="hljs-keyword">if</span> (arr[i] === arr[k]) {  <span class="hljs-comment">//&#x5982;&#x679C;&#x540E;&#x9762;&#x6709;&#x91CD;&#x590D;&#x7684;&#x5C31;&#x8DF3;&#x8FC7;</span>
            flag = <span class="hljs-literal">true</span>
            k = arr.length
          }
        }
        <span class="hljs-keyword">if</span> (!flag) result.push(arr[i]) <span class="hljs-comment">//&#x6CA1;&#x6709;&#x91CD;&#x590D;&#x7684;&#xFF0C;&#x6DFB;&#x52A0;&#x5230;&#x6570;&#x7EC4;&#x4E2D;</span>
      }
      <span class="hljs-keyword">return</span> result
    }
<span class="hljs-comment">//3. &#x5229;&#x7528;&#x6570;&#x7EC4;&#x7684;indexOf&#x65B9;&#x6CD5; </span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unique</span>(<span class="hljs-params">arr</span>) </span>{
      <span class="hljs-keyword">let</span> result = []
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>, len = arr.length; i &lt; len; i++) {
        <span class="hljs-keyword">if</span> (result.indexOf(arr[i]) === <span class="hljs-number">-1</span>) result.push(arr[i])
      }
      <span class="hljs-keyword">return</span> result
    }
<span class="hljs-comment">//4. &#x5229;&#x7528;&#x7C7B;&#x4F3C;&#x6876;&#x6392;&#x5E8F;&#x7684;&#x65B9;&#x6CD5;</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unique</span>(<span class="hljs-params">arr</span>) </span>{
      <span class="hljs-keyword">let</span> result = []   
      <span class="hljs-keyword">let</span> bucket = [];  <span class="hljs-comment">//&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6876;</span>
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>, len = arr.length; i &lt; len; i++) {
        bucket[arr[i]] = <span class="hljs-number">1</span>   <span class="hljs-comment">//&#x5C06;&#x6709;&#x4E9B;&#x6876;&#x6807;&#x8BB0;</span>
      }
      <span class="hljs-keyword">for</span> (key <span class="hljs-keyword">in</span> bucket) { <span class="hljs-comment">//&#x53D6;&#x51FA;&#x6709;&#x6807;&#x8BB0;&#x7684;&#x6876;&#x7684;&#x4E0B;&#x6807;</span>
        <span class="hljs-built_in">console</span>.log(key);
        result.push(<span class="hljs-built_in">Number</span>(key))
      }
      <span class="hljs-keyword">return</span> result
    }
<span class="hljs-comment">//5. &#x5229;&#x7528;filter&#x65B9;&#x6CD5;</span>
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unique</span>(<span class="hljs-params">arr</span>) </span>{
      <span class="hljs-keyword">return</span> arr.filter((ele, index) =&gt; (arr.indexOf(ele) === index)) <span class="hljs-comment">//&#x8FC7;&#x6EE4;</span>
    }

<span class="hljs-comment">//6. &#x5229;&#x7528;map&#x65B9;&#x6CD5;</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unique</span>(<span class="hljs-params">arr</span>) </span>{
      <span class="hljs-keyword">return</span> arr.map((ele, index) =&gt; {
        <span class="hljs-keyword">if</span> (arr.indexOf(ele) === index) <span class="hljs-keyword">return</span> ele
      })
    }
<span class="hljs-comment">//7.&#x6392;&#x5E8F;&#x540E;&#x8FDB;&#x884C;&#x6570;&#x7EC4;</span>
 <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">unique</span>(<span class="hljs-params">arr</span>) </span>{
      arr.sort()
      <span class="hljs-keyword">let</span> result = []
      arr.forEach((ele, index) =&gt; {
        <span class="hljs-keyword">if</span> (ele !== arr[index + <span class="hljs-number">1</span>]) result.push(ele)
      })
      <span class="hljs-keyword">return</span> result
    }
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0;-asyncawait"><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0;-asyncawait" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0;-asyncawait"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0;-asyncawait" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0;-asyncawait"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-24">&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x6A21;&#x62DF;&#x5B9E;&#x73B0; async/await</p></h3>
<pre><code class="lang-javascript">

</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;&#x8BA2;&#x9605;&#x6A21;&#x5F0F;"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;&#x8BA2;&#x9605;&#x6A21;&#x5F0F;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;&#x8BA2;&#x9605;&#x6A21;&#x5F0F;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;&#x8BA2;&#x9605;&#x6A21;&#x5F0F;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;&#x8BA2;&#x9605;&#x6A21;&#x5F0F;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-25">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x5B9E;&#x73B0;&#x53D1;&#x5E03;/&#x8BA2;&#x9605;&#x6A21;&#x5F0F;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Subject</span> </span>{ <span class="hljs-comment">//&#x5B9A;&#x4E49;&#x88AB;&#x89C2;&#x5BDF;&#x8005;</span>
  <span class="hljs-keyword">constructor</span>() {
    <span class="hljs-keyword">this</span>.observers = []
  }

  addObserver(observer) { <span class="hljs-comment">//&#x8BA2;&#x9605;</span>
    <span class="hljs-keyword">this</span>.observers.push(observer)
  }

  removerObserver(observer) {<span class="hljs-comment">//&#x53D6;&#x6D88;&#x8BA2;&#x9605;</span>
    <span class="hljs-keyword">let</span> index = <span class="hljs-keyword">this</span>.observers.indexOf(observer)
    <span class="hljs-keyword">if</span> (index !== <span class="hljs-number">-1</span>) {
      <span class="hljs-keyword">this</span>.observers.splice(index, <span class="hljs-number">1</span>)
    }

  }

  notify() {  <span class="hljs-comment">//&#x901A;&#x77E5;</span>
    <span class="hljs-keyword">this</span>.observers.forEach(observer =&gt; {
      observer.update()
    })
  }
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Observer</span> </span>{ <span class="hljs-comment">// &#x5B9A;&#x4E49;&#x89C2;&#x5BDF;&#x8005;</span>
  update() {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;subject&#x66F4;&#x65B0;&#x4E86;&apos;</span>);
  }
  subscribeTo(subject) {
    subject.addObserver(<span class="hljs-keyword">this</span>)
  }
}

<span class="hljs-keyword">let</span> subject = <span class="hljs-keyword">new</span> Subject() <span class="hljs-comment">//&#x88AB;&#x89C2;&#x5BDF;&#x8005;</span>
<span class="hljs-keyword">let</span> observer1 = <span class="hljs-keyword">new</span> Observer()  <span class="hljs-comment">//&#x89C2;&#x5BDF;&#x8005;</span>
observer1.subscribeTo(subject) <span class="hljs-comment">//&#x89C2;&#x5BDF;&#x8005;&#x8FDB;&#x884C;&#x8BA2;&#x9605;</span>
<span class="hljs-keyword">let</span> observer2 = <span class="hljs-keyword">new</span> Observer()  <span class="hljs-comment">//&#x89C2;&#x5BDF;&#x8005;</span>
observer2.subscribeTo(subject) <span class="hljs-comment">//&#x89C2;&#x5BDF;&#x8005;&#x8FDB;&#x884C;&#x8BA2;&#x9605;</span>
subject.notify()
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x9632;&#x6296;"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x9632;&#x6296;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x9632;&#x6296;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x9632;&#x6296;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x9632;&#x6296;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-26">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x9632;&#x6296;</p></h3>
<pre><code class="lang-javascript">funtion debounce(fn,delay){
    <span class="hljs-keyword">let</span> timer = <span class="hljs-literal">null</span>
    <span class="hljs-keyword">return</span> ()=&gt;{
        clearTimeout(timer)
        timer =  setTimeout(()=&gt;(fn())
        ,delay)
    }
}

<span class="hljs-keyword">let</span> a = debounce(()=&gt;(<span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x9632;&#x6296;&#x5904;&#x7406;&apos;</span>)),<span class="hljs-number">500</span>)

<span class="hljs-function"><span class="hljs-keyword">function</span> &#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&#xFF08;&#xFF09;</span>{
    a()
}
</code></pre>
<h3 id="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x8282;&#x6D41;"><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x8282;&#x6D41;" class="anchor-navigation-ex-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x8282;&#x6D41;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x8282;&#x6D41;" class="plugin-anchor" href="#&#x2605;&#x2605;&#x2605;&#x2605;-&#x624B;&#x5199;&#x8282;&#x6D41;"><i class="fa fa-link" aria-hidden="true"></i></a><p id="hw-27">&#x2605;&#x2605;&#x2605;&#x2605; &#x624B;&#x5199;&#x8282;&#x6D41;</p></h3>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">throttle</span>(<span class="hljs-params">fn, delay = 500</span>) </span>{
  <span class="hljs-keyword">let</span> lastTime, time
  <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{
       <span class="hljs-keyword">let</span> context = <span class="hljs-keyword">this</span>;
    <span class="hljs-keyword">let</span> args = [].slice.call(<span class="hljs-built_in">arguments</span>);
    time = <span class="hljs-built_in">Date</span>.now()
    <span class="hljs-keyword">if</span> (!lastTime || time - lastTime &gt; delay) {
      fn.apply(context)
      lastTime = time
    }
  }
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params"></span>)</span>{
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x8282;&#x6D41;&apos;</span>)
}

<span class="hljs-keyword">let</span> a =  throttle(fn, <span class="hljs-number">1000</span>)

<span class="hljs-function"><span class="hljs-keyword">function</span> &#x70B9;&#x51FB;&#x4E8B;&#x4EF6;(<span class="hljs-params"></span>)</span>{
    a()
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../security/" class="navigation navigation-prev " aria-label="Previous page: 安全">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../algorithm/" class="navigation navigation-next " aria-label="Next page: 高频算法">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"手写代码","level":"1.13","depth":1,"next":{"title":"高频算法","level":"1.14","depth":1,"path":"algorithm/index.md","ref":"./algorithm/index.md","articles":[]},"previous":{"title":"安全","level":"1.12","depth":1,"path":"security/index.md","ref":"./security/index.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","expandable-chapters-small","anchors","github","github-buttons","sharing-plus","anchor-navigation-ex","favicon","insert-logo"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"github":{"url":"https://github.com/lurongtao/felixbooks-interview"},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"favicon":{"shortcut":"./source/images/favicon.jpg","bookmark":"./source/images/favicon.jpg","appleTouch":"./source/images/apple-touch-icon.jpg","appleTouchMore":{"120x120":"./source/images/apple-touch-icon.jpg","180x180":"./source/images/apple-touch-icon.jpg"}},"github-buttons":{"buttons":[{"user":"lurongtao","repo":"felixbooks-interview","type":"star","size":"small","count":true}]},"expandable-chapters-small":{},"sharing":{"qq":false,"all":["google","facebook","weibo","twitter","qq","qzone","linkedin","pocket"],"douban":false,"facebook":false,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"insert-logo":{"url":"/felixbooks-interview2/images/logo-interview.png","style":"background: skyblue; width: 100%; height: 100%;"}},"theme":"default","author":"古艺散人","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"千锋大前端小册-企业面试真题","language":"zh-hans","links":{},"gitbook":"3.2.3","description":"Electron 入门与实战"},"file":{"path":"handwritten/index.md","mtime":"2021-05-06T23:22:47.649Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-05-06T23:31:20.692Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

